#include<iostream>
#include<unordered_map>
using namespace std;

int main() {
    int n, a, q;
    unordered_map<int, int> mp;
    cin >> n;
    for(int i=1; i<=n; i++) {
        cin >> a;
        mp[a] = i;
    }
    cin >> q;
    while(q--) {
        cin >> a;
        cout << mp[a] << endl;
    }
    return 0;
} 